function p = gmm_pdf(X, gmm)
    N = size(X, 1);
    d = size(X, 2);
    p = zeros(N, 1);
    for i = 1 : N
        x = X(i,:)';
        p(i) = 1 / ((2 * pi)^(d/2) * sqrt(det(gmm.sigma))) * exp(-0.5 * (x - gmm.mu)' * inv(gmm.sigma) * (x - gmm.mu));
    end
end
